/**
 * 1.封装弹框控件
 * @time 2016/6/15
 * @User zzw
 */
DialogBox = function () {
    var self = this;
    //消息提示框
    /**
     *
     * @param id 控件的唯一标识
     * @param title 控件标题信息
     * @param content 内容
     * @constructor
     */
    self.Alert = function (id, title, content) {
        var messageFrame = '<div class="modal fade" id="' + id + '" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">' +
            '<div class="modal-dialog"><div class="modal-content"> ' +
            '<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>' +
            '<h4 class="modal-title" id="myModalLabel">' + title + '</h4></div>' +
            '<div class="modal-body">' + content + '</div>' +
            '<div class="modal-footer">' +
            '<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>' +
            '<button type="button" class="btn btn-primary">提交</button></div></div></div></div>';
        $('body').append(messageFrame);
        $("#" + id).modal('show');
    };

    /**
     * 确认框
     * @param id 控件的唯一标识
     * @param title 控件标题信息
     * @param content 内容
     * @param callback 回调函数
     * @constructor
     */
/*    self.Comfirm = function (id, title, content, callback) {
        var messageFrame = '<div id="' + id + '" class="modal hide fade" tabindex="-1" data-backdrop="static" data-keyboard="false">' +
            '<div class="modal-body">' +
            '<p>删除' + title + '?</p></div>' +
            '<div class="modal-footer">' +
            '<button type="button" data-dismiss="modal" class="btn">取消</button>' +
            '<button type="button" data-dismiss="modal" class="btn btn-primary">确认</button></div></div>';
        $('body').append(messageFrame);
        $("#" + id).modal('show');
    };*/
    /**
     * 输入框
     * @param id 控件的唯一标识
     * @param title 控件标题信息
     * @param content 内容
     * @param callback 回调函数
     * @constructor
     */
    self.Prompt = function (id, title, content, callback) {
        var messageFrame = '<div class="modal fade" id="' + id + '" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">' +
            '<div class="modal-dialog"><div class="modal-content"> ' +
            '<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>' +
            '<h4 class="modal-title" id="myModalLabel">' + title + '</h4></div>' +
            '<div class="modal-body">' +
            '姓名 <input type="text" data-tabindex="1" /><br>' +
            '性别 <input type="text" data-tabindex="2" />' +
            '</div>' +
            '<div class="modal-footer">' +
            '<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>' +
            '<button type="button" class="btn btn-primary">提交</button></div></div></div></div>';
        $('body').append(messageFrame);
        $("#" + id).modal('show');
    }
};

var dialogBox = new DialogBox();
